package com.spi.soconversion.orders.conversion;

public enum ItemType {
	
	ALL("ALL", ""),
	EFEE("EFEE", ""),
	SPE("SPE", ""),
	STD("STD", ""),
	USE("USE", ""),
	WRFEE("WRFEE", ""),
	SVG("SVG", "DSOPT"),
	PINS("3PINS","PS"),
	ASBL("ASBL","PS"),
	CON("CON", "PROD"),
    CUS("CUS", "PROD"),
	DEL("DEL", ""),
	HU("HU", "PS"),
	INS("INS", "PS"),
	LNR("LNR","PROD"),
	NC("NC","PROD"),
	SB("SB", "PROD"),
	SP("SP", "PROD"),
	WTY("WTY", "PROD");

	private String code;
	private String displayText;
			
	private ItemType(String code,String displayText) {
		this.code= code;
		this.displayText=displayText;
	}
			
	/**
	 * Get the item type
	 * @param cofiValue
	 * @return
	 */
	public static String getMCFItemType(String cofiValue) {
		for (ItemType it : ItemType.values()) {
			if (it.code.equals(cofiValue)) {
				return it.displayText;
			}
		}
		return null;
	}
	
	public static boolean isConversionRequired(String cofiValue) {
		for (ItemType it : ItemType.values()) {
			if (it.code.equals(cofiValue)) {
				return true;
			}
		}
		return false;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getDisplayText() {
		return displayText;
	}

	public void setDisplayText(String displayText) {
		this.displayText = displayText;
	}		
}